<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>219-正则对象上的test方法.html</title>
</head>
<body>
	
</body>
<script>
	var str = "x1x1x1x1";
	// var reg = /[a-z]/g;	
	var reg = /[a-z]/;
	console.log(str);
	console.log(reg.lastIndex);
	console.log(reg.test(str));
	console.log(reg.lastIndex);
	console.log(reg.test(str));
	console.log(reg.lastIndex);
	console.log(reg.test(str));
	console.log(reg.lastIndex);
	console.log(reg.test(str));
	console.log(reg.lastIndex);
</script>
</html>